//
//  ST_UserCenterModel.swift
//  BTVideo
//
//  Created by DouLei on 2019/10/24.
//  Copyright © 2019 DouLei. All rights reserved.
//

import UIKit
import HandyJSON
import SwifterSwift



//MARK: - Model
class UserPreviewModel: NSObject,HandyJSON{
    
    
    required override init() {
    }
    
    var user = ST_BTUserinfo()
    
    var tag: Array<UserPreviewTagModel> = []
    
    var video: Array<UserPreviewVideoModel> = []
    //    新增
    var preview_videos: Array<ST_MediaResourceModel> = []
    
    var extra_data = BTAccountExtension()
    
    var talk = false
    
    var is_like = false
}

extension UserPreviewModel{
    
    func handleTagsWidth(){
        
        for item in tag{
            
            let textWidth = item.title.width(withConstrainedHeight: 80, font: UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.regular))
            
            item.tagCellWidth = 33 + textWidth + 10
        }
    }
    
}


class UserPreviewTagModel: NSObject,HandyJSON{
    
    required override init() {
    }

    var id = ""
    
    var title = ""
    
    var icon_url = ""
    
    var tagCellWidth = 80.cgFloat
    
    var isSelected = false
}




class UserPreviewVideoModel: NSObject,HandyJSON{
    
    required override init() {
    }
    
    var id = ""
    
    var comment_times = 0
    
    var cover_img = ""
    
    var full_url = ""
    
    var screen_type = 1
    
    var intro = ""
    
    var state = 0
    
//  后台字段  1普通 2封面
    var is_cover = 0
}
